package com.vegetable.modules.entity.baseData;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vegetable.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="AccountDetails对象", description="")
public class AccountDetails extends BaseEntity {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long producerId;

    @ApiModelProperty(value = "人员类型：0农户，1客商，2代办，3班组")
    private Integer staffType;

    @ApiModelProperty(value = "0收菜；1批次结算；2付款；3收款；4交货；5加工；6打包,7直销，8代销")
    private Integer detailType;

    @ApiModelProperty(value = "人员id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long personId;

    @ApiModelProperty(value = "订单id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orderId;

    @ApiModelProperty(value = "订单时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date orderTime;

    @ApiModelProperty(value = "单号")
    private String docNo;

    @ApiModelProperty(value = "金额")
    @JsonSerialize(nullsUsing = NullSerializer.class)
    private BigDecimal money;

    @ApiModelProperty(value = "折扣")
    @JsonSerialize(nullsUsing = NullSerializer.class)
    private BigDecimal discount;

    @ApiModelProperty(value = "待办补")
    @JsonSerialize(nullsUsing = NullSerializer.class)
    private BigDecimal agentDiscount;

    @ApiModelProperty(value = "提成")
    @JsonSerialize(nullsUsing = NullSerializer.class)
    private BigDecimal bonus;

    @ApiModelProperty(value = "收不回")
    @JsonSerialize(nullsUsing = NullSerializer.class)
    private BigDecimal noReturn;

    @ApiModelProperty(value = "支付完成标识0未对账，1已付款,2已对账未付款")
    private Integer isPayFinish;

    @ApiModelProperty(value = "商品名称")
    @TableField(exist = false)
    private String commodityName;

    @ApiModelProperty(value = "计划数量")
    @TableField(exist = false)
    private Integer planNumber;

    @ApiModelProperty(value = "计划重量")
    @TableField(exist = false)
    private BigDecimal planWeight;

    @ApiModelProperty(value = "实际支付金额")
    @TableField(exist = false)
    private BigDecimal actualPay;
}
